﻿using Mes.Domain.BoundedContext;

namespace Mes.Application.DTO.Inputs.MasterData
{
    public class MeasuringUnitInput
    {
        /// <summary>
        /// 计量单位名称
        /// </summary>
        public string UnitName { get; set; } = string.Empty;

        /// <summary>
        /// 计量单位编码
        /// </summary>
        public string UnitCode { get; set; } = string.Empty;

        /// <summary>
        /// 单位类型 关联计量单位类型配置表主键
        /// </summary>
        public int UnitType { get; set; } = 0;

        /// <summary>
        /// 单位简称  例如  厘米 简称  cm
        /// </summary>
        public string Abbreviation { get; set; } = string.Empty;

        /// <summary>
        /// 关联换算单位 关联此表主键编号
        /// </summary>
        public int ConversionUnit { get; set; } = 0;

        /// <summary>
        /// 单位兑换比率  例如  dm：cm-> 1:10   格式为 XX:XX
        /// </summary>
        public string Ratio { get; set; } = string.Empty;

        /// <summary>
        /// 备注
        /// </summary>
        public string? Note { get; set; } = string.Empty;
    }

    public class MeasuringUnitUpdateInput : MeasuringUnitInput
    {
        /// <summary>
        /// id
        /// </summary>
        public int Id { get; set; }
    }

    public class MeasuringUnitPageInput
    {
        /// <summary>
        /// 计量单位类型名称
        /// </summary>
        public string UnitName { get; set; } = string.Empty;

        /// <summary>
        /// 当前编辑的计量单位
        /// </summary>
        public int? CurrentMeasuringUnitId { get; set; } = null;    // 增加此字段是为了分页时过滤掉当前编辑的计量单位自身

        public PagedInput PagedInput { get; set; }
    }
}
